package avicit.cbb.techclass.billdefine.service.api;

import avicit.cbb.techclass.billdefine.domain.CbbTabFormConfig;
import avicit.cbb.techclass.tabledefine.commtablemanager.domain.CbbTabColumns;
import avicit.cbb.techclass.tabledefine.commtempletmanager.domain.CbbTempletCode;
import avicit.platform6.core.dao.Paging;
import avicit.platform6.core.jdbc.Page;
import avicit.platform6.core.rest.msg.ResponseMsg;
import avicit.platform6.core.restclient.RestClient;
import avicit.platform6.core.restclient.RestClientUtils;

import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Component
public class BillDefineManagerServiceApi {


    /**
     * 服务编码
     */
    private static final String SERVICE_CODE = "filebasicmanager";

    private static final String BASE_PATH = "/api/avicit/cbb/techclass/billdefine/action/rest/BillDefineManagerRest";

    @Autowired
    private RestClient restClient;

    /**
     *  基本字段查询对象
     * @param tableId
     * @param s
     * @param tableName
     * @param s1
     * @param sysId
     * @param orgId
     * @param deptId
     * @return
     */
    public List<CbbTabColumns> getFormShowTableList(String tableId, String s, String tableName, String s1, String sysId, String orgId, String deptId) {
        String url = BASE_PATH + "/getFormShowTableList";
        Map<String, Object> map = new HashMap<>();
        map.put("tableId",tableId);
        map.put("s",s);
        map.put("tableName",tableName);
        map.put("s1",s1);
        map.put("sysId",sysId);
        map.put("orgId",orgId);
        map.put("deptId",deptId);
        ResponseMsg<List<CbbTabColumns>> responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<List<CbbTabColumns>>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }

    /**
     * 根据表ID,节点ID判断表单是否存在
     * @param tableId
     * @param nodeId
     * @param archiveStatus
     * @return
     */
    public boolean checkHasForm(String tableId, String nodeId, String archiveStatus) {
        String url = BASE_PATH + "/checkHasForm";
        Map<String,Object> map = new HashMap<>();
        map.put("tableId",tableId);
        map.put("nodeId",nodeId);
        map.put("archiveStatus",archiveStatus);
        ResponseMsg<Boolean> responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<Boolean>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }


    /**
     * 根据表ID,节点ID判断表单是否存在
     * @param tableId
     * @param nodeId
     * @return
     */
    public boolean checkHasForm2(String tableId, String nodeId) {
        String url = BASE_PATH + "/checkHasForm2";
        Map<String,Object> map = new HashMap<>();
        map.put("tableId",tableId);
        map.put("nodeId",nodeId);
        ResponseMsg<Boolean> responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<Boolean>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }

    /**
     * 获取表单配置信息中的列信息
     * @param page
     * @param parameter
     * @return
     */
    public Page<Map<String, Object>> getPageBillFormConfigList(Paging<CbbTempletCode> page, Map<String, Object> parameter) {
        String url = BASE_PATH + "/getPageBillFormConfigList";
        Map<String,Object> map = new HashMap<>();
        map.put("page",page);
        map.put("parameter",parameter);
        ResponseMsg<Page<Map<String, Object>>> responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<Page<Map<String, Object>>>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }

    /**
     * 获取模版库表单列信息
     * @param page
     * @param parameter
     * @param orgId
     * @return
     */
    public Page<Map<String, Object>> getPageBillDbList(Paging<CbbTempletCode> page, Map<String, Object> parameter, String orgId) {
        String url = BASE_PATH + "/getPageBillDbList";
        Map<String,Object> map = new HashMap<>();
        map.put("page",page);
        map.put("parameter",parameter);
        map.put("orgId",orgId);
        ResponseMsg<Page<Map<String, Object>>> responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<Page<Map<String, Object>>>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }

    /**
     * 判断表单管理树节点对应表是否有数据
     * @param tableId
     * @return
     */
    public int getTableDataCount(String tableId) {
        String url = BASE_PATH + "/getTableDataCount";
        ResponseMsg<Integer> responseMsg = restClient.doPost(SERVICE_CODE, url, tableId, new ParameterizedTypeReference<ResponseMsg<Integer>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }

    /**
     * 更新表单配置表信息
     * @param cbbTabFormConfig
     */
    public void updateCbbTabForm(CbbTabFormConfig cbbTabFormConfig) {
        String url = BASE_PATH + "/updateCbbTabForm";
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, cbbTabFormConfig, new ParameterizedTypeReference<ResponseMsg<T>>() {
        });
    }

    /**
     *创建表单信息 参数：系统标识ID，节点ID，节点名称，库表ID
     * @param sysId
     * @param nodeName
     * @param orgId
     * @param deptId
     * @param tableId
     * @param nodeId
     * @param json
     * @param archiveStatus
     */
    public void createCbbTabForm(String sysId, String nodeName, String orgId, String deptId, String tableId, String nodeId, String json, String archiveStatus) {
        String url = BASE_PATH + "/createCbbTabForm";
        Map<String,Object> map = new HashMap<>();
        map.put("sysId",sysId);
        map.put("nodeName",nodeName);
        map.put("orgId",orgId);
        map.put("deptId",deptId);
        map.put("tableId",tableId);
        map.put("nodeId",nodeId);
        map.put("json",json);
        map.put("archiveStatus",archiveStatus);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<T>>() {
        });
    }

    /**
     * 表单管理重置
     * @param sysId
     * @param nodeId
     * @param tableId
     * @param archiveStatus
     */
    public void resetFormDataByArchiveFormId(String sysId, String nodeId, String tableId, String archiveStatus) {
        String url = BASE_PATH + "/resetFormDataByArchiveFormId";
        Map<String,Object> map = new HashMap<>();
        map.put("sysId",sysId);
        map.put("nodeId",nodeId);
        map.put("tableId",tableId);
        map.put("archiveStatus",archiveStatus);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<T>>() {
        });
    }

    /**
     *
     * @param sysId
     * @param nodeId
     * @param tableId
     */
    public void resetFormDataByFormId(String sysId, String nodeId, String tableId) {
        String url = BASE_PATH + "/resetFormDataByFormId";
        Map<String,Object> map = new HashMap<>();
        map.put("sysId",sysId);
        map.put("nodeId",nodeId);
        map.put("tableId",tableId);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<T>>() {
        });
    }

    /**
     * 根据表单配置ID获取该对象
     * @param formConfigId
     * @return
     */
    public CbbTabFormConfig getcbbTabFormConfigById(String formConfigId) {
        String url = BASE_PATH + "/getcbbTabFormConfigById";
        ResponseMsg<CbbTabFormConfig> responseMsg = restClient.doPost(SERVICE_CODE, url, formConfigId, new ParameterizedTypeReference<ResponseMsg<CbbTabFormConfig>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }

    /**
     * 创建表单信息 参数：系统标识ID，节点ID，节点名称，库表ID
     * @param sysId
     * @param nodeName
     * @param orgId
     * @param deptId
     * @param tableId
     * @param nodeId
     * @param json
     */
    public void createCbbTabForm2(String sysId, String nodeName, String orgId, String deptId, String tableId, String nodeId, String json) {
        String url = BASE_PATH + "/createCbbTabForm2";
        Map<String,Object> map = new HashMap<>();
        map.put("sysId",sysId);
        map.put("nodeName",nodeName);
        map.put("orgId",orgId);
        map.put("deptId",deptId);
        map.put("tableId",tableId);
        map.put("nodeId",nodeId);
        map.put("json",json);
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, map, new ParameterizedTypeReference<ResponseMsg<T>>() {
        });
    }

    /**
     * 获取模板列数
     * @param param
     * @return
     */
    public String getModelColumn(Map<String, Object> param) {
        String url = BASE_PATH + "/getModelColumn";
        ResponseMsg<String> responseMsg = restClient.doPost(SERVICE_CODE, url, param, new ParameterizedTypeReference<ResponseMsg<String>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }

    /**
     * 设置模版列数
     * @param param
     */
    public void setModelColumn(Map<String, Object> param) {
        String url = BASE_PATH + "/setModelColumn";
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, param, new ParameterizedTypeReference<ResponseMsg<T>>() {
        });
    }


    /**
     *表单数据新增方法
     * @param json
     * @param sysId
     * @param tableName
     * @param nodeName
     * @param nodeId
     * @param orgId
     * @param deptId
     * @param loginUserId
     * @param loginIp
     */
    public void insertFormData(String json,String sysId,String tableName,String nodeName,String nodeId,String orgId,String deptId,String loginUserId,String loginIp) {
        Map<String,Object> resMaps = new HashMap<>();
        resMaps.put("json",json);
        resMaps.put("sysId",sysId);
        resMaps.put("tableName",tableName);
        resMaps.put("nodeName",nodeName);
        resMaps.put("nodeId",nodeId);
        resMaps.put("orgId",orgId);
        resMaps.put("deptId",deptId);
        resMaps.put("loginUserId",loginUserId);
        resMaps.put("loginIp",loginIp);
        String url = BASE_PATH + "/insertFormData/v1";
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg>() {
        });
        return;
    }


    /**
     *获取列信息对象集合
     * @param tableId
     * @param flag
     * @return
     */
    public List<CbbTabColumns> getFormShowList(String tableId,String flag) {
        Map<String,Object> resMaps = new HashMap<>();
        resMaps.put("tableId",tableId);
        resMaps.put("flag",flag);
        String url = BASE_PATH + "/getFormShowList/v1";
        ResponseMsg<List<avicit.cbb.techclass.tabledefine.commtablemanager.domain.CbbTabColumns>> responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg<List<avicit.cbb.techclass.tabledefine.commtablemanager.domain.CbbTabColumns>>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }


    /**
     *表单数据更新方法
     * @param json
     * @param sysId
     * @param tableName
     * @param nodeName
     * @param nodeId
     * @param id
     * @param orgId
     * @param deptId
     */
    public void updateFormData(String json,String sysId,String tableName,String nodeName,String nodeId,String id,String orgId,String deptId) {
        Map<String,Object> resMaps = new HashMap<>();
        resMaps.put("json",json);
        resMaps.put("sysId",sysId);
        resMaps.put("tableName",tableName);
        resMaps.put("nodeName",nodeName);
        resMaps.put("nodeId",nodeId);
        resMaps.put("id",id);
        resMaps.put("orgId",orgId);
        resMaps.put("deptId",deptId);
        String url = BASE_PATH + "/updateFormData/v1";
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg>() {
        });
        return;
    }





//    public void updateCbbTabForm(avicit.cbb.techclass.billdefine.domain.CbbTabFormConfig cbbTabFormConfig) {
//        Map<String,Object> resMaps = new HashMap<>();
//        resMaps.put("cbbTabFormConfig",cbbTabFormConfig);
//        String url = BASE_PATH + "/updateCbbTabForm/v1";
//        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg>() {
//        });
//        return;
//    }





//    public void createCbbTabForm(String sysId,String nodeName,String orgId,String deptId,String tableId,String nodeId,String json) {
//        Map<String,Object> resMaps = new HashMap<>();
//        resMaps.put("sysId",sysId);
//        resMaps.put("nodeName",nodeName);
//        resMaps.put("orgId",orgId);
//        resMaps.put("deptId",deptId);
//        resMaps.put("tableId",tableId);
//        resMaps.put("nodeId",nodeId);
//        resMaps.put("json",json);
//        String url = BASE_PATH + "/createCbbTabForm/v1";
//        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg>() {
//        });
//        return;
//    }





//    public void createCbbTabForm(String sysId,String nodeName,String orgId,String deptId,String tableId,String nodeId,String json,String archiveStatus) {
//        Map<String,Object> resMaps = new HashMap<>();
//        resMaps.put("sysId",sysId);
//        resMaps.put("nodeName",nodeName);
//        resMaps.put("orgId",orgId);
//        resMaps.put("deptId",deptId);
//        resMaps.put("tableId",tableId);
//        resMaps.put("nodeId",nodeId);
//        resMaps.put("json",json);
//        resMaps.put("archiveStatus",archiveStatus);
//        String url = BASE_PATH + "/createCbbTabForm/v1";
//        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg>() {
//        });
//        return;
//    }


    /**
     *获取列代码信息
     * @param page
     * @param parameter
     * @param orgId
     * @return
     */
    public Page<Map<String, Object>> getPageBillDetailList(Paging<CbbTempletCode> page, Map<String, Object> parameter, String orgId) {
        Map<String,Object> resMaps = new HashMap<>();
        resMaps.put("page",page);
        resMaps.put("parameter",parameter);
        resMaps.put("orgId",orgId);
        String url = BASE_PATH + "/getPageBillDetailList/v1";
        ResponseMsg<Page<Map<String, Object>>> responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg<Page<Map<String, Object>>>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }


    /**
     *根据CID 获取FormConfig主键ID
     * @param cid
     * @return
     */
    public String getCbbTabFormConfigByCid(String cid) {
        Map<String,Object> resMaps = new HashMap<>();
        resMaps.put("cid",cid);
        String url = BASE_PATH + "/getCbbTabFormConfigByCid/v1";
        ResponseMsg<String> responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg<String>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }





//    public CbbTabFormConfig getcbbTabFormConfigById(String id) {
//        Map<String,Object> resMaps = new HashMap<>();
//        resMaps.put("id",id);
//        String url = BASE_PATH + "/getcbbTabFormConfigById/v1";
//        ResponseMsg<avicit.cbb.techclass.billdefine.domain.CbbTabFormConfig> responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg<avicit.cbb.techclass.billdefine.domain.CbbTabFormConfig>>() {
//        });
//        return RestClientUtils.getResponseBody(responseMsg);
//    }


    /**
     *获取列数据源
     * @param page
     * @param parameter
     * @param orgId
     * @param deptId
     * @return
     */
    public Page<Map<String, Object>> getPageCodeDetailList(Paging<CbbTabColumns> page,Map<String, Object> parameter,String orgId,String deptId) {
        Map<String,Object> resMaps = new HashMap<>();
        resMaps.put("page",page);
        resMaps.put("parameter",parameter);
        resMaps.put("orgId",orgId);
        resMaps.put("deptId",deptId);
        String url = BASE_PATH + "/getPageCodeDetailList/v1";
        ResponseMsg<Page<Map<String, Object>>> responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg<Page<Map<String, Object>>>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }





//    public List<CbbTabColumns> getFormShowTableList(String tableId,String id,String tableName,String flag,String sysId,String orgId,String deptId) {
//        Map<String,Object> resMaps = new HashMap<>();
//        resMaps.put("tableId",tableId);
//        resMaps.put("id",id);
//        resMaps.put("tableName",tableName);
//        resMaps.put("flag",flag);
//        resMaps.put("sysId",sysId);
//        resMaps.put("orgId",orgId);
//        resMaps.put("deptId",deptId);
//        String url = BASE_PATH + "/getFormShowTableList/v1";
//        ResponseMsg<List<CbbTabColumns>> responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg<List<CbbTabColumns>>>() {
//        });
//        return RestClientUtils.getResponseBody(responseMsg);
//    }


    /**
     *根据formId和字段ID判断是否存在表单配置信息
     * @param formId
     * @param colId
     * @return
     */
    public Boolean getformConfigByFormIdAndColId(String formId,String colId) {
        Map<String,Object> resMaps = new HashMap<>();
        resMaps.put("formId",formId);
        resMaps.put("colId",colId);
        String url = BASE_PATH + "/getformConfigByFormIdAndColId/v1";
        ResponseMsg<Boolean> responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg<Boolean>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }





//    public void resetFormDataByArchiveFormId(String sysId,String nodeId,String tableId,String archiveStatus) {
//        Map<String,Object> resMaps = new HashMap<>();
//        resMaps.put("sysId",sysId);
//        resMaps.put("nodeId",nodeId);
//        resMaps.put("tableId",tableId);
//        resMaps.put("archiveStatus",archiveStatus);
//        String url = BASE_PATH + "/resetFormDataByArchiveFormId/v1";
//        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg>() {
//        });
//        return;
//    }


    /**
     *根据tabNodeId获取formId
     * @param tableNodeId
     * @return
     */
    public String getFormIdByTableNodeId(String tableNodeId) {
        Map<String,Object> resMaps = new HashMap<>();
        resMaps.put("tableNodeId",tableNodeId);
        String url = BASE_PATH + "/getFormIdByTableNodeId/v1";
        ResponseMsg<String> responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg<String>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }


    /**
     *根据tabNodeId获取formId
     * @param tableNodeId
     * @param archiveStatus
     * @return
     */
    public String getFormIdByTableNodeId(String tableNodeId,String archiveStatus) {
        Map<String,Object> resMaps = new HashMap<>();
        resMaps.put("tableNodeId",tableNodeId);
        resMaps.put("archiveStatus",archiveStatus);
        String url = BASE_PATH + "/getFormIdByTableNodeId/v2";
        ResponseMsg<String> responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg<String>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }


    /**
     *根据formId删除表单配置信息
     * @param formId
     */
    public void deleteFormDataByFormId(String formId) {
        Map<String,Object> resMaps = new HashMap<>();
        resMaps.put("formId",formId);
        String url = BASE_PATH + "/deleteFormDataByFormId/v1";
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg>() {
        });
        return;
    }


    /**
     *通过TABLEID取得列信息表格显示对象集合(只用于添加页面)
     * @param tableId
     * @param id
     * @param tableName
     * @param flag
     * @param sysId
     * @param orgId
     * @param deptId
     * @param selectedId
     * @return
     */
    public List<CbbTabColumns> getFormShowTableListToAdd(String tableId,String id,String tableName,String flag,String sysId,String orgId,String deptId,String selectedId) {
        Map<String,Object> resMaps = new HashMap<>();
        resMaps.put("tableId",tableId);
        resMaps.put("id",id);
        resMaps.put("tableName",tableName);
        resMaps.put("flag",flag);
        resMaps.put("sysId",sysId);
        resMaps.put("orgId",orgId);
        resMaps.put("deptId",deptId);
        resMaps.put("selectedId",selectedId);
        String url = BASE_PATH + "/getFormShowTableListToAdd/v1";
        ResponseMsg<List<CbbTabColumns>> responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg<List<CbbTabColumns>>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }





//    public com.github.pagehelper.Page<Map<String, Object>> getPageBillFormConfigList(avicit.platform6.core.dao.Paging<avicit.cbb.techclass.tabledefine.commtempletmanager.domain.CbbTempletCode> page,Map<String, Object> parameter) {
//        Map<String,Object> resMaps = new HashMap<>();
//        resMaps.put("page",page);
//        resMaps.put("parameter",parameter);
//        String url = BASE_PATH + "/getPageBillFormConfigList/v1";
//        ResponseMsg<com.github.pagehelper.Page<Map<String, Object>>> responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg<com.github.pagehelper.Page<Map<String, Object>>>>() {
//        });
//        return RestClientUtils.getResponseBody(responseMsg);
//    }





//    public Integer getTableDataCount(String tableId) {
//        Map<String,Object> resMaps = new HashMap<>();
//        resMaps.put("tableId",tableId);
//        String url = BASE_PATH + "/getTableDataCount/v1";
//        ResponseMsg<Integer> responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg<Integer>>() {
//        });
//        return RestClientUtils.getResponseBody(responseMsg);
//    }


    /**
     *获取部门用户字符串
     * @param tableId
     * @param sysId
     * @param orgId
     * @return
     */
    public String getUserDpetString(String tableId,String sysId,String orgId) {
        Map<String,Object> resMaps = new HashMap<>();
        resMaps.put("tableId",tableId);
        resMaps.put("sysId",sysId);
        resMaps.put("orgId",orgId);
        String url = BASE_PATH + "/getUserDpetString/v1";
        ResponseMsg<String> responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg<String>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }





//    public com.github.pagehelper.Page<Map<String, Object>> getPageBillDbList(avicit.platform6.core.dao.Paging<avicit.cbb.techclass.tabledefine.commtempletmanager.domain.CbbTempletCode> page,Map<String, Object> parameter,String orgId) {
//        Map<String,Object> resMaps = new HashMap<>();
//        resMaps.put("page",page);
//        resMaps.put("parameter",parameter);
//        resMaps.put("orgId",orgId);
//        String url = BASE_PATH + "/getPageBillDbList/v1";
//        ResponseMsg<com.github.pagehelper.Page<Map<String, Object>>> responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg<com.github.pagehelper.Page<Map<String, Object>>>>() {
//        });
//        return RestClientUtils.getResponseBody(responseMsg);
//    }


    /**
     *表单数据删除方法
     * @param dataid
     * @param tableName
     * @param sysId
     * @param orgId
     * @param deptId
     */
    public void deleteFormDataById(String dataid,String tableName,String sysId,String orgId,String deptId) {
        Map<String,Object> resMaps = new HashMap<>();
        resMaps.put("dataid",dataid);
        resMaps.put("tableName",tableName);
        resMaps.put("sysId",sysId);
        resMaps.put("orgId",orgId);
        resMaps.put("deptId",deptId);
        String url = BASE_PATH + "/deleteFormDataById/v1";
        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg>() {
        });
        return;
    }





//    public void resetFormDataByFormId(String sysId,String nodeId,String tableId) {
//        Map<String,Object> resMaps = new HashMap<>();
//        resMaps.put("sysId",sysId);
//        resMaps.put("nodeId",nodeId);
//        resMaps.put("tableId",tableId);
//        String url = BASE_PATH + "/resetFormDataByFormId/v1";
//        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg>() {
//        });
//        return;
//    }


    /**
     *根据deptId查找deptName
     * @param id
     * @return
     */
    public String getDeptNameById(String id) {
        Map<String,Object> resMaps = new HashMap<>();
        resMaps.put("id",id);
        String url = BASE_PATH + "/getDeptNameById/v1";
        ResponseMsg<String> responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg<String>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }


    /**
     *获取基本字段生成方式为通用代码的字段集合
     * @param list
     * @param flag
     * @param sysId
     * @param orgId
     * @return
     */
    public Map<String, Map<String, String>> getRuleCodeList(List<avicit.cbb.techclass.tabledefine.commtablemanager.domain.CbbTabColumns> list,String flag,String sysId,String orgId) {
        Map<String,Object> resMaps = new HashMap<>();
        resMaps.put("list",list);
        resMaps.put("flag",flag);
        resMaps.put("sysId",sysId);
        resMaps.put("orgId",orgId);
        String url = BASE_PATH + "/getRuleCodeList/v1";
        ResponseMsg<Map<String, Map<String, String>>> responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg<Map<String, Map<String, String>>>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }


    /**
     *根据userId查找userName
     * @param id
     * @return
     */
    public String getUserNameById(String id) {
        Map<String,Object> resMaps = new HashMap<>();
        resMaps.put("id",id);
        String url = BASE_PATH + "/getUserNameById/v1";
        ResponseMsg<String> responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg<String>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }


    /**
     *根据sysCode查找sysName
     * @param code
     * @return
     */
    public String getSysNameByCode(String code) {
        Map<String,Object> resMaps = new HashMap<>();
        resMaps.put("code",code);
        String url = BASE_PATH + "/getSysNameByCode/v1";
        ResponseMsg<String> responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg<String>>() {
        });
        return RestClientUtils.getResponseBody(responseMsg);
    }





//    public Boolean checkHasForm(String tableId,String nodeId,String archiveStatus) {
//        Map<String,Object> resMaps = new HashMap<>();
//        resMaps.put("tableId",tableId);
//        resMaps.put("nodeId",nodeId);
//        resMaps.put("archiveStatus",archiveStatus);
//        String url = BASE_PATH + "/checkHasForm/v1";
//        ResponseMsg<Boolean> responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg<Boolean>>() {
//        });
//        return RestClientUtils.getResponseBody(responseMsg);
//    }





//    public Boolean checkHasForm(String tableId,String nodeId) {
//        Map<String,Object> resMaps = new HashMap<>();
//        resMaps.put("tableId",tableId);
//        resMaps.put("nodeId",nodeId);
//        String url = BASE_PATH + "/checkHasForm/v1";
//        ResponseMsg<Boolean> responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg<Boolean>>() {
//        });
//        return RestClientUtils.getResponseBody(responseMsg);
//    }





//    public String getModelColumn(Map<String, Object> param) {
//        Map<String,Object> resMaps = new HashMap<>();
//        resMaps.put("param",param);
//        String url = BASE_PATH + "/getModelColumn/v1";
//        ResponseMsg<String> responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg<String>>() {
//        });
//        return RestClientUtils.getResponseBody(responseMsg);
//    }





//    public void setModelColumn(Map<String, Object> param) {
//        Map<String,Object> resMaps = new HashMap<>();
//        resMaps.put("param",param);
//        String url = BASE_PATH + "/setModelColumn/v1";
//        ResponseMsg responseMsg = restClient.doPost(SERVICE_CODE, url, resMaps, new ParameterizedTypeReference<ResponseMsg>() {
//        });
//        return;
//    }






}
